package com.nulstudio.sppm.mapper;

import com.nulstudio.sppm.domain.vo.CommodityVo;
import com.nulstudio.sppm.entity.NulCommodity;
import org.apache.ibatis.annotations.Param;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommodityMapper {
    @NonNull
    List<CommodityVo> fetchCommodityList(@Param("name") @NonNull String name);

    int insert(@Param("commodity") @NonNull NulCommodity commodity);

    int update(@Param("commodity") @NonNull NulCommodity commodity);

    int delete(@Param("id") @NonNull List<Integer> id);

    boolean checkExistenceById(@Param("id") int id);
}
